<%@ page import="java.util.List" %>
<%@ page import="entity.MixPFO" %>
<%--
  Created by IntelliJ IDEA.
  User: zhouya
  Date: 2019/6/20/0020
  Time: 16:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="../js/common.js"></script>
    <%
        List<MixPFO> list=(List<MixPFO>) request.getAttribute("list");
        int current_page = (int)request.getAttribute("page");
        int sum = (int)request.getAttribute("sum");
        int num_every_page = (int)request.getAttribute("num_every_page");
        int last_page = (int)request.getAttribute("last_page");
    %>

    <style rel="stylesheet" type="text/css" >
        table{border: 1px solid gray;border-collapse: collapse;width: 100% }
        td{border: 1px solid gray;text-align: center;}
        a {color: rgba(1, 4, 12, 0.97); text-decoration:none;}
        a:visited {text-decoration:none;}
        a:hover {color:#ba2636;text-decoration:underline;}
        a:active {color:#ba2636;}

        #page_box{
            height: 25px;
            border: 1px solid #9cc8ec;
            background-color: white;
        }
    </style>
</head>
<body>
<div>
        文章栏目：
        <select id="fieldId" ondblclick="getField()">
            <option value=12>教学方法</option>
            <option value=42>教学视频</option>
            <option value=41>教学课件</option>
            <option value=52>研究成果</option>
            <option value=51>研究项</option>
            <option value=22>联系人资料</option>
            <option value=16>课程动态</option>
            <option value=14>课程大纲</option>
            <option value=13>课程安排</option>
            <option value=32>课程建设内容</option>
            <option value=31>课程建设规划</option>
            <option value=15>课程理念与目标</option>
            <option value=11>课程简介</option>
            <option value=21>课程组成员</option>
            <option value=17>课程负责人</option>
        </select>
        创建时间：从<input type="datetime" id="begin" onchange="getBegin()" value="2019-06-18 20:29:55" />
        到<input type="datetime" id="end" onchange="getEnd()" value="2019-06-30 20:29:55" />
    <button onclick="getfileTBE()">确认</button>
</div>
    <table bgcolor="white">
        <tr>
            <td class="field">栏目名称</td>
            <td class="title">文章标题</td>
            <td class="operator">作者</td>
            <td class="createDate">创建日期</td>
            <td class="roof">是否置顶</td>
            <td class="operate">操作</td>
        </tr>
        <%for(MixPFO mix:list){%>
        <tr>
            <td class="field"><%=mix.getFieldName()%></td>
            <td class="title"><%=mix.getTitle()%></td>
            <td class="operator"><%=mix.getOperatorName()%></td>
            <td class="createDate"><%=mix.getCreateDate()%></td>
            <td class="roof"><%=mix.getRoof()%></td>
            <td><a href="ReviewPassageDetailServlet?passageId=<%=mix.getPassageID()%>">详情</a>
                <a href="ReviewInsertServlet?passageId=<%=mix.getPassageID()%>">通过</a>
                <a href="ReviewDeleteServlet?passageId=<%=mix.getPassageID()%>">不通过</a>
            </td>
        </tr>
        <%}%>
    </table>

<form action="ReviewPassageServlet" method="post" id="page_box" >
    <input type="text" style="display: none;" id="current_page" value="<%=current_page%>" />
    <input type="text" style="display: none;" id="last_page" value="<%=last_page%>" />
    <input type="text" style="display: none;" name="page" id="next_page" />

    <input type="submit" style="margin-left:500px;border: 0;width: 9px;background-image: url('../image/first_page.png')" onclick="to_first_page()" id="page_first_btn" value="">
    <input type="submit" style="border: 0;width: 11px;background-image: url('../image/page_up.png')"  onclick="page_up()" id="page_up_btn" value=""> |
    <input type="text" value="<%=current_page %>" style="width: 32px;height: 18px;border: 1px solid #abadb3">
    <span style="color:royalblue">共<%=last_page %>页</span>|
    <input type="submit" style="border: 0;width: 11px;background-image: url('../image/page_down.png')" onclick="page_down()" id="page_down_btn" value="">
    <input type="submit" style="border: 0;width: 9px;background-image: url('../image/last_page.png')" onclick="to_last_page()" id="page_last_btn" value="">
    <select id="pages" onchange="submitForm(); ">
        <%for(int i = 1; i <= last_page; i++){%>
        <option  value="<%=i %>" <%if(i == current_page){%> selected <%}%> ><%=i %></option>
        <%}%>
    </select>
    <span style="color:royalblue;margin-left: 300px;">
                <%= (current_page-1) * num_every_page + 1%>
                -
                <%=Math.min(current_page * num_every_page, sum)%>
                共<%=sum %>条
        </span>
    <script>page_initial();</script>
</form>

</body>
<script type="text/javascript" language="javascript" src="../js/index.js"></script>
</html>